<?php
namespace hotel\common\models;
use Yii;
use hotel\common\models\BaseModel;
/**
	* 订单 共用模型
 */

class OrdersModel extends BaseModel
{

	public static function tableName()
	{
		return '{{%order%}}';
	}

	/*
		* 订单列表
		* whereArr 条件
		* params 基本参数 包含 field order page limit
		* extends  扩展信息 一些相关的信息
		* 
	*/
	public static function getOrderList($whereArr,$params,$extends=array())
	{
		$model  = self::find();
		$where  = $whereArr['where'];
		$whereAnd = isset($whereArr['whereAnd'])?$whereArr['whereAnd']:[];
		$models = self::queryFormart($model,$where,$params,$whereAnd);
		$model  = $models['model'];
		self::$pages = $models['pages'];

		$data  = $model->asarray()->all();
		if(!$data) return array();

		return $data;				
	}	



}